
//  import axios from 'axios'
//  export default async function wxConfig() {
//    console.log('url',location.href.split('#')[0])
//    let url = 'http://wx.yuyou100.com/wechat/config?signatureUrl=' + encodeURIComponent(encodeURIComponent(window.location.href.split('#')[0]))
//    let res = await axios.get(url,{dataType:'json'})
//    console.log(res, 'res')
//    if (res.status === 200) {
//      wx.config({
//        debug: true,
//        appId: res.data.appId,
//        timestamp: res.data.timestamp,
//        nonceStr: res.data.nonceStr,
//        signature: res.data.signature,
//        jaApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline']
//      })
//       wx.error(function () { alert('config失败') })
//      wx.checkJsApi({
//        jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline'],
//        success: function (res) {
//          console.log(res)
//        }
//      });
//    }
//  }

 export default function wxConfig() {
   $.ajax({
     url: 'http://wx.yuyou100.com/wechat/config?signatureUrl=' + encodeURIComponent(encodeURIComponent(window.location.href.split('#')[0])),
    dataType: 'json',
    success: function (data) {
      wx.config({
        debug: false,
        appId: data.appId,
        timestamp: data.timestamp,
        nonceStr: data.nonceStr,
        signature: data.signature,
        jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline','checkJsApi']
      });
      wx.error(function (res) {
      });
    }
  });


}